<template>
  <!-- 热门推荐 -->
  <div class="hot-recom">
    <div class="hot-title flex justify-between">
      <span>热门推荐</span>
      <span class="text-gray-500 mr-10">更多<i class="iconfont iconjinrujiantou text-12"></i></span>
    </div>
    <div class="hot-item flex border-b" v-for="(item, index) in list" :key="index" @click="goDetail(item.id)">
      <div class="item-left">
        <img :src="item.cover" alt="" />
      </div>
      <div class="item-right">
        <div class="text-14">{{ item.name }}</div>
        <div class="text-12 text-gray-400 w-full line-2">{{ item.desc }}</div>
        <div class="text-red-600">
          <span class="text-12">￥</span>
          <span class="text-18">{{ item.price }}</span>
          <span class="text-12 text-gray-400">起</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HotRecom',
  props: {
    list: Array,
  },
  methods: {
    goDetail(id) {
      this.$router.push({ path: '/detail', query: { id } })
    },
  },
}
</script>

<style lang="scss" scoped>
.hot-recom {
  .hot-title {
    line-height: 0.4rem;
    background: #eee;
    text-indent: 0.1rem;
  }
  .hot-item {
    margin: 0.1rem 0.1rem 0 0.1rem;
    .item-left {
      img {
        width: 1rem;
        height: 0.8rem;
        border-radius: 0.05rem;
      }
    }
    .item-right {
      width: calc(100% - 1rem);
      margin-left: 0.1rem;
      .title {
        font-size: 0.14rem;
      }
      .text {
        font-size: 0.12rem;
      }
    }
  }
}
</style>
